{template 'common/header'}
<div class="nav nav-tabs">
<ul class="nav nav-tabs">
  <li {if $opp == 'cards'}class="active"{/if}><a href="{php echo $this->createWebUrl('cards');}">名片管理</a></li>
  <li {if $opp == 'indus'}class="active"{/if}><a href="{php echo $this->createWebUrl('indus');}">行业设置</a></li>
  <!-- <li {if $opp == 'card_overrule'}class="active"{/if}><a href="{php echo $this->createWebUrl('card_overrule');}">顶置设置</a></li> -->
  <!-- <li {if $opp == 'videosetup'}class="active"{/if}><a href="{php echo $this->createWebUrl('videosetup');}">视频设置</a></li> -->
  <!-- <li {if $opp == 'wxacode'}class="active"{/if}><a href="{php echo $this->createWebUrl('wxacode');}">专属二维码设置</a></li> -->
</ul>
</div>
<ul class="nav nav-tabs">
	<li {if $operation == 'post'}class="active"{/if}><a href="{php echo $this->createWebUrl('indus', array('op' => 'post'))}">{if $id==0}添加行业{else}修改行业{/if}</a></li>
	<li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('indus', array('op' => 'display'))}">管理行业</a></li>
</ul>
{if $operation == 'post'}
<div class="main">
    <form action="" method="post" class="form-horizontal form" id="form1">
        <div class="panel panel-default">
            <div class="panel-heading">行业详细设置</div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">名称</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" name="catename" class="form-control" value="{$indus['name']}" />
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
                <input type="hidden" name="token" value="{$_W['token']}" />
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
</script>
{elseif $operation == 'display'}
<div class="main">
	<div class="slide">
		<form action="" method="post" onsubmit="return formcheck(this)">
            <div class="panel panel-default">
                <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th style="width:10px;"></th>
                            <th style="width:10px;">ID</th>
                            <th style="width:10px;">名称</th>
                            <th style="width:20px;" class="text-center">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    {loop $indus $row}
                        <tr>
                            <td>{if count($children[$row['id']]) > 0}<a href="javascript:;"><i class="icon-chevron-down"></i></a>{/if}</td>
                            <td>
                                {$row['id']}
                            </td>
                            <td>
                                {$row['name']}
                            </td>
                            
                            <td class="text-center">
                                <a href="{php echo $this->createWebUrl('indus', array('op' => 'post', 'id' => $row['id']))}" title="编辑" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top"><i class="fa fa-edit"></i></a>
                                <a href="{php echo $this->createWebUrl('indus', array('op' => 'delete','id' => $row['id']))}" onclick="return confirm('确认删除行业吗？');return false;" title="删除" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top"><i class="fa fa-times"></i></a>
                            </td>
                        </tr>
                    {/loop}
                        <tr>
                            <td></td>
                            <td colspan="4">
                                <a href="{php echo $this->createWebUrl('indus', array('op' => 'post'))}"><i class="fa fa-plus"></i> 添加新行业</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
                </div>
            </div>
        </form>
	</div>
</div>
{/if}

{template 'common/footer'}
